<%@page import="com.hui.platform.system.utility.StringUtil"%>
<%@page import="com.oceansoft.core.domain.SysResource"%>
<%@page import="java.util.List"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<%
String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String init = (String)session.getAttribute("init");
SysUser user = (SysUser) request.getSession().getAttribute(Constant.LOGIN_USER);
System.out.println("user="+user);
List<SysResource> rlist = (List<SysResource>)session.getAttribute("rlist");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
    <%--后台管理首页 --%> 
    <title>${title}</title>
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>   
	<meta http-equiv="Page-Enter" content="revealTrans(Duration=0.3,Transition=2)"/>
	<link rel="stylesheet" type="text/css" href="<c:url value='/resource/css/css.css'/>"/>
	<link rel="stylesheet" type="text/css" href="<c:url value='/resource/css/menu-css.css'/>" />
	<link rel="stylesheet" type="text/css" href="<c:url value='/resource/css/jquery.tabs.css'/>"/>
<!--[if IE 6]>
<script src="<c:url value='/resource/js/DD_belatedPNG.js'/>"></script>
<script>
  DD_belatedPNG.fix('#top');
 // DD_belatedPNG.fix('.active');
 // DD_belatedPNG.fix('.inactive');
 // DD_belatedPNG.fix('.icon_1000024');
 // DD_belatedPNG.fix('.icon_1000025');
</script>
<![endif]-->
	<style>
body{ margin:0px; padding:0px; font:12px Verdana, Geneva, sans-serif;}
img{ border:0px;}
.header{ width:100%; height:71px; background:url(<c:url value='/resource/images/index_top_logo.gif'/>) left top no-repeat; background-color:#1a5aa0;}
.h_right{ width:362px; height:71px; float:right; color:#FFF;}
.h_right_l{ width:200px; height:51px; float:left; background-color:#487bb3; padding:10px 10px; line-height:25px;}
#webjx{width:100%;height:25px; line-height:25px; }
.h_right_r{ width:71px; height:71px; float:left;}
.h_right_r a{ display:block; width:71px; height:71px; }
.h_r_password{ background:url(<c:url value='/resource/images/zx_icon_password.gif'/>) 0 0 no-repeat;}
.h_r_close{ background:url(<c:url value='/resource/images/zx_icon_close.gif'/>) 0 0 no-repeat;}
.h_r_password:hover{ background:url(<c:url value='/resource/images/zx_icon_password_a.gif'/>) 0 0 no-repeat;}
.h_r_close:hover{ background:url(<c:url value='/resource/images/zx_icon_close_a.gif'/>) 0 0 no-repeat;}
</style>
	<script type="text/javascript" src="<c:url value='/resource/js/jquery-1.7.2.min.js'/>"></script>
	<link rel="stylesheet" type="text/css" href="<c:url value='/resource/css/jquery.loadmask.css'/>"/>
	<script type="text/javascript" src="<c:url value='/resource/artdialog/artdialog.js?skin=${sys_theme}'/>"></script>
	<script type="text/javascript" src="<c:url value='/resource/artdialog/iframetools.js'/>"></script>	
	<script type="text/javascript" src="<c:url value='/resource/js/jquery.loadmask.min.js'/>"></script>
	<script type="text/javascript" src="<c:url value='/resource/js/view/admin.js'/>"></script>
	<script type="text/javascript" src="<c:url value='/resource/js/menu_min.js'/>"></script>
	<script type="text/javascript" src="<c:url value='/resource/js/map.js'/>"></script>
	<script type="text/javascript" src="<c:url value='/resource/js/view/tab.js'/>"></script>
	<style >
	.active {
	background:url(<c:url value='/resource/images/icon_on.png'/>) 232px 12px no-repeat;
	}
	.inactive {
		background:url(<c:url value='/resource/images/icon_off.png'/>) 232px 12px no-repeat;
	}
	</style>
	<script type="text/javascript">
		var ROOT_PATH = "<%=basePath%>";
		function exitSys(){
			art.dialog.confirm("是否确认退出系统？",function(){
				window.location.href="<c:url value='/profile/exit.html'/>";
			});
		}
		
		function sessionTimeout(){
			window.location.href="<c:url value='/profile/exit.html'/>";
		}
		
		$(function(){
			 $(".menu ul li").menu();
		});
		
		

		
		function addContent()
		{
			//art.dialog.data("desc", content);
			art.dialog.open('<c:url value="content/gotoadd.html"/>', {
				title : "系统留言",
				lock : true,
				width : 550,
				height : 250,
				fixed : true,
				ok: function () {
					var iframe = this.iframe.contentWindow;
					if(!iframe.document.body){
						art.dialog.tips("正在加载，请稍候...",1500);
						return false;
					}
					iframe.submitForm();
					return false;
				},
				cancel: true

			});
		}
		
		
		//var ms = document.getElementsByName("menu");
		//ms[0].click();
		//ms[2].click();
		
		
		
		
		function showPage(u,id,name)
		{
			//document.getElementById('tab_head').innerHTML+= '<span id="page2">测试</span>';
			//alert("a"+u+"a")
			if(u&&u!='null')
			{
				
			   createTab(id,name,u);
			}
			//ifrm2.location.replace(u)
			
		}
		
		
		
	</script>
	</head>
	<body scorll='no'>
	
	
	<div class="header">
<div class="h_right">
<div class="h_right_l">用户：${_SESSION_LOGIN_USER.name}
<div id="webjx"></div>
   <script>setInterval("webjx.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
   </script>
</div>
<div class="h_right_r"><a href="javascript:changePassword()" class="h_r_password"></a></div>
<div class="h_right_r"><a href="javascript:exitSys();" class="h_r_close"></a></div>
</div>
</div>
	
<div id="main" style=" margin:0 auto; width:980px; margin:2px 2px 2px 2px; overflow:auto ;">
<div id='left_menu' style="width:200px; border:2px solid #5ea5e3; overflow:hidden; float:left; margin-right:5px;">
<div class="menu">
    <ul>
    <!-- 我的任务 -->
     <%
     			for(int i=0;i<rlist.size();i++)
     			{
     				SysResource s = rlist.get(i);
     				
     				String url_ = s.getUrl();
     				if(StringUtil.isNull(url_))
     				{
     					//url_ = "javascript:void(0)";
     				}
     				else
     				{
     					url_ = path +"/"+url_;
     				}
     				
     				if(s.getDeep()==1)
     				{
     					%>
     					<li id="m_<%=s.getDbid()%>"    ><a class="inactive"    id="menu0" name='menu' href=javascript:showPage("<%=url_%>","<%=s.getDbid()%>","<%=s.getName()%>") onclick="changeState(this);"><%=s.getName() %></a></li>
     					<% 
     				}
     				else if(s.getDeep()==2)
     				{
     					String parentId = s.getParent_id();
     					
     					%>
     					<script>
     					   var p = document.getElementById("m_<%=parentId%>");
     					   //判断是否已经有ul
     					   var u = document.getElementById("m_u_<%=parentId%>");
     					   if(u)
   						   {
     						 
   						   }
     					   else
   						   {
     						  p.innerHTML += "<ul id='m_u_<%=parentId%>'></ul>";	
     						  u = document.getElementById("m_u_<%=parentId%>");
   						   }
     					   
     					   u.innerHTML += '<li id="m_u_l_<%=s.getDbid()%>" ><a name="menu" href=javascript:showPage("<%=url_%>","<%=s.getDbid()%>","<%=s.getName()%>") onclick="changeState(this);"  ><%=s.getName()%></a></li>';
     					</script>
						<%
     				}
     				else if(s.getDeep()==3)
     				{
     					String parentId = s.getParent_id();
     				    %>
     				    <script>
     					   var p = document.getElementById("m_u_l_<%=parentId%>");
     					 //  alert(p)
     					   //判断是否已经有ul
     					   var u = document.getElementById("m_u_l_s_<%=parentId%>");
     					   if(u)
   						   {
     						 
   						   }
     					   else
   						   {
     						  p.innerHTML += "<ul id='m_u_l_s_<%=parentId%>'></ul>";	
     						  u = document.getElementById("m_u_l_s_<%=parentId%>");
   						   }
     					   
     					   u.innerHTML += '<li id="m_u_l_s_<%=s.getDbid()%>" ><a name="menu" onclick="changeState(this)"  href=javascript:showPage("<%=url_%>","<%=s.getDbid()%>","<%=s.getName()%>") ><%=s.getName()%></a></li>';
     					</script>
     				    <%
     				}
     				
     			}
     %>
     
    </ul>
  </div>
</div>
<!--left-->

    <span id="page-1" style="z-index: 999;position: absolute;right:5px;top:85px;display: none">
<img src="<%=path %>/resource/images/mbi_002.gif"    onclick="startLeft()" />
     </span>

     <span id="page-2" style="z-index: 999;position: absolute;right:5px;display: none">
<img   src="<%=path %>/resource/images/mbi_004.gif"  onclick="trunRight()" />
     </span>




<div id="jd" class="ui-layout-center" style="">
     <div id="tabH" style="height:33px;padding-left:0px;overflow-x: hidden;" >
		<h2 id="tab_head" class="ui-tab"  >
		</h2>
     </div>
     <div id="tab_body" class="ui-tab-panels" style="position: absolute;top:100px;left:211px ; overflow: hidden" >
         
	 </div>
</div>


 <div id='foot_div'  style="position:absolute;bottom:0px;left:0px; height:36px; line-height:36px; text-align:center; background-color:#1a5aa0;color:#ffffff;">版权所有©苏州市公安局&nbsp;&nbsp;&nbsp;技术支持:江苏欧索软件有限公司</div>
 
</div>
	</body>
</html>
